package coder520.mq.controller.service;

import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * 接收消息
 */

@Component("queueReceicer1")
public class QueueReceicer1 implements MessageListener{


    @Override
    public void onMessage(Message message) {

        try {
            System.out.println("queueReceicer1message:"+((TextMessage)message).getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
